package com.sn.springboot_netty.ip;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * @Author fyy
 * @Description
 * @Date 2020/12/1 16:37
 */
public class UrlUtil {

    public static void main(String[] args) throws IOException {
        URL url = new URL("https://www.bilibili.com/video/BV19a4y1p7wJ?p=5");
        System.out.println("协议：" + url.getProtocol());
        System.out.println("主机：" + url.getHost());
        System.out.println("端口：" + url.getPort());
        System.out.println("默认端口：" + url.getDefaultPort());
        System.out.println("资源路径：" + url.getPath());
        System.out.println("文件：" + url.getContent());
    }
}
